﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace AppDemo
{
    /// <summary>
    /// Interaction logic for Window10.xaml
    /// </summary>
    public partial class Window10 : Window
    {
        public Window10()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            
        }

        private void aa_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                int line = aa.SelectionStart;
                var start = aa.Text.Substring(0, line);
                var end = string.Empty;
                if (aa.Text.Length > line)
                {
                    end = aa.Text.Substring(line);
                }
                aa.Text =start+ Environment.NewLine+end;
                aa.SelectionStart = line+1;
            }
        }
    }
}
